package com.usian.skill.mq;

import com.alibaba.fastjson.JSON;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;


@Component
@Slf4j
public class MqSender {

    @Autowired
    AmqpTemplate amqpTemplate;

    public void sendmiaoshaMessage(Object mm){
        String j = JSON.toJSONString(mm);
        log.info("send message:"+j);
        amqpTemplate.convertAndSend(MqConfig.QUEUE,j);
    }

    public void sendSkillMsgage(SkillMsgAge msg){
        String j = JSON.toJSONString(msg);
        log.info("send message:"+j);
        amqpTemplate.convertAndSend(MqConfig.SKillQUEUE,j);
    }

}
